package com.zking.ssm.PMQ.service.imp;

import com.zking.ssm.PMQ.mapper.UserMapper;
import com.zking.ssm.PMQ.model.User;
import com.zking.ssm.PMQ.service.IUserService;
import com.zking.ssm.util.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserMapper userMapper;

    public UserServiceImpl() {
    }

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public int deleteByPrimaryKey(Long usrId) {
        return userMapper.deleteByPrimaryKey(usrId);
    }

    @Override
    public int insertUserRole(User record){
       return userMapper.insertUserRole(record);
    }

    @Override
    public int insert(User record) {
        return userMapper.insert(record);
    }

    @Override
    public User selectByPrimaryKey(Long usrId) {
        User us = userMapper.selectByPrimaryKey(usrId);
        return us;
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return userMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<User> listUser(User record, PageBean pageBean) {
        return userMapper.listUser(record);
    }

    @Override
    public int revokeCategory(Long usrId) {
        return userMapper.revokeCategory(usrId);
    }

    @Override
    public int deleteAll(User record) {
        return userMapper.deleteAll(record);
    }

    @Override
    public int deletes(User record) {
        return userMapper.deletes(record);
    }

    @Override
    public int updateRole(User record){
        return userMapper.updateRole(record);
    }
}
